package com.tjec.project.system.mapper;

import com.tjec.framework.web.domain.TreeSelectAndChildrenNum;
import com.tjec.project.system.domain.BmsMdBusinessCategory;
import com.tjec.project.system.domain.vo.BmsMdBusinessCategoryVO;

import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * 业务类别管理Mapper接口
 *
 * @author tjec
 * @date 2020-04-03
 */
public interface BmsMdBusinessCategoryMapper {
    /**
     * 查询业务类别管理
     *
     * @param id 业务类别管理ID
     * @return 业务类别管理
     */
    public BmsMdBusinessCategory selectBmsMdBusinessCategoryById(String id);

    /**
     * 查询业务类别管理列表
     *
     * @param bmsMdBusinessCategory 业务类别管理
     * @return 业务类别管理集合
     */
    public List<BmsMdBusinessCategory> selectBmsMdBusinessCategoryList(BmsMdBusinessCategory bmsMdBusinessCategory);

    /**
     * 新增业务类别管理
     *
     * @param bmsMdBusinessCategory 业务类别管理
     * @return 结果
     */
    public int insertBmsMdBusinessCategory(BmsMdBusinessCategory bmsMdBusinessCategory);

    /**
     * 修改业务类别管理
     *
     * @param bmsMdBusinessCategory 业务类别管理
     * @return 结果
     */
    public int updateBmsMdBusinessCategory(BmsMdBusinessCategory bmsMdBusinessCategory);

    /**
     * 删除业务类别管理
     *
     * @param id 业务类别管理ID
     * @return 结果
     */
    public int deleteBmsMdBusinessCategoryById(String id);

    /**
     * 批量删除业务类别管理
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteBmsMdBusinessCategoryByIds(String[] ids);

    /**
     * 查询业务类别数据
     *
     * @param businessCategory 务类别信息
     * @return 业务类别信息集合
     */
    List<BmsMdBusinessCategory> selectBusinessCategoryAndChildrenNumList(BmsMdBusinessCategory businessCategory, @Param("tableName") String tableName);

    /**
     * 查询一级类别的所有下属类别
     *
     * @param businessCategoryId 类别id
     * @return 业务类别信息集合
     */
    List<String> selectBmsMdBusinessCategoryChildIdsOne(@Param("guid") String businessCategoryId);

    /**
     * 查询二级类别的所有下属类别
     *
     * @param businessCategoryId 类别id
     * @return 业务类别信息集合
     */
    List<String> selectBmsMdBusinessCategoryChildIdsTwo(@Param("guid") String businessCategoryId);

    /**
     * 查询业务类别管理
     *
     * @param guid 业务类别管理ID
     * @return 业务类别管理
     */
    public BmsMdBusinessCategory selectBmsMdBusinessCategoryByGuId(@Param("guid") String guid);
    
    /**
     * 查询业务类别管理
     *
     * @param guid 业务类别管理ID
     * @return 业务类别管理
     */
    public BmsMdBusinessCategory selectBmsMdBusinessCategoryByGuIdLimit(@Param("guid") String guid);
    
    /**
     * 查询业务类别管理
     *
     * @param guid 业务类别管理ID
     * @return 业务类别管理
     */
    public BmsMdBusinessCategoryVO selectBmsMdBusinessCategoryByGuIdNew(@Param("guid") String guid);

    /**
     * 查询业务类别管理  一个对应多个业务类别
     *
     * @param businessCategory
     * @return 业务类别管理
     */
    public List<BmsMdBusinessCategory> selectBusinessCategorySelectOneToMore(BmsMdBusinessCategory businessCategory, @Param("tableName") String tableName);

    public List<TreeSelectAndChildrenNum> selectFunOptions();

    /**
     * 根据各业务guid，查询对应的业务类别
     *
     * @param guid 各业务guid(公用参数)
     * @param businessCategoryId 业务类别guid
     * @return
     */
    List<BmsMdBusinessCategory> selectBusinessCategoryByCategoryAssociated(@Param("guid")String guid,@Param("businessCategoryId")String businessCategoryId);

    /**
     * 查询工程招标及工程招标子类
     * @return
     */
//    List<String> selectEngineeringBidding(@Param("menuName") String businessCategoryName);

    List<BmsMdBusinessCategory> selectBusinessCategoryByCategoryAssociatedId(String guid);

    Set<String> selectGuidByParentId(@Param("menuName") String menuName, @Param("parentId") String parentId);
    
    public Integer checkAgency(String businessTypeId);
    
    /**
     * 获取项目服务范围内的业务类别
     * @param projectId 项目id
     * @return
     */
    public List<BmsMdBusinessCategory> selectBusinessCategoryLists(String businessTypeId);
    
    /**
     * 获取项目服务范围内的业务类别
     * @param projectId 项目id
     * @return
     */
    public List<BmsMdBusinessCategoryVO> selectBusinessCategoryListsNew(String businessTypeId);
    
    public List<String> getBusinessTypes(Set<String> set);
}
